<?php

/**
 * Flickr Photosets - Library
 * This file should be included from every page. It includes all necessary files for the app.
 * 
 * @author Brad Dougherty <bdougherty@gmail.com>
 * @version 8.6.14
 * @license http://www.gnu.org/licenses/gpl.html GNU General Public License 3.0
 */

/*
Include the database connection information
Defines constants APP_DOWN, DB_TYPE, DB_HOST, DB_NAME, DB_TABLE, DB_USER, DB_PASS,
FACEBOOK_API_KEY, FACEBOOK_API_SECRET, FLICKR_API_KEY,
FLICKR_API_SECRET, GOOGLEMAPS_API_KEY, GOOGLE_ANALYTICS_ACCOUNT,
CACHE_DIR, REVISION
*/
require_once 'config.php';

/*
Include the Facebook client library
*/
require_once 'libs/facebook/facebook.php';

/*
Include the phpFlickr library
Current version: 2.1.0
*/
require_once 'libs/phpFlickr/phpFlickr.php';

/**
 * Autoload the classes as needed, all are located in classes subdir
 * @param string $class_name The class to load
 */
function __autoload($class_name) {
	if (substr($class_name, 0, 3) == 'FP_') {
		// FP_ClassName
		$class_file = 'classes/'.substr($class_name, 3).'.php';
	}
	else {
		// Other Classes
		$class_file = 'classes/'.$class_name.'.php';
	}
	
	require_once $class_file;
}

/*
Turn Facebook library debugging off
*/
$globals['facebook_config']['debug'] = false;

?>